﻿<Page
    x:Name="pageRoot"
    x:Class="BootyBay.PrivateStoreApp.AppCategoriesPage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BootyBay.PrivateStoreApp"
    xmlns:common="using:BootyBay.PrivateStoreApp.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Page.TopAppBar>
        <AppBar BorderThickness="1" BorderBrush="#99205B96" Margin="0,-2,0,0">
            <Grid Height="105" Background="#99205B96">
                <StackPanel Orientation="Horizontal">
                    <Button Margin="27,0,0,0" Content="主页" Background="#77ACE1" BorderThickness="0" Style="{StaticResource AppsPage_Home_ButtonStyle}" x:Name="btn_Home" Click="btn_Home_Click"></Button>
                    <Button Margin="10,0,0,0" Content="你的应用" Background="#77ACE1" BorderThickness="0" Style="{StaticResource AppsPage_YourApps_ButtonStyle}" x:Name="btn_AppList" Click="btn_AppList_Click"></Button>
                </StackPanel>
            </Grid>
        </AppBar>
    </Page.TopAppBar>
    <Page.Resources>
        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">推荐</x:String>
        <x:String x:Key="ChevronGlyph">&#xE26B;</x:String>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid>
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.Background>
            <ImageBrush ImageSource="Images/bg.png"></ImageBrush>
        </Grid.Background>
        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Margin="39,0,39,0" Command="{Binding NavigationHelper.GoBackCommand, ElementName=pageRoot}"
                        Style="{StaticResource NavigationBackButtonNormalStyle}"
                        VerticalAlignment="Center"
                        AutomationProperties.Name="Back"
                        AutomationProperties.AutomationId="BackButton"
                        AutomationProperties.ItemType="Navigation Button"/>
            <TextBlock x:Name="pageTitle" Text="{StaticResource AppName}" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1" 
                        IsHitTestVisible="false" TextWrapping="NoWrap" VerticalAlignment="Center" Margin="0,0,30,0"/>
        </Grid>
        <GridView Grid.Row="1" x:Name="itemGridView"
                              Padding="120,0,0,0"
                              AutomationProperties.AutomationId="ItemGridView"
                              AutomationProperties.Name="Items In Group"
                              ItemTemplate="{StaticResource AppListItemTemplate}"
                              ItemContainerStyle="{StaticResource AppGridViewItemStyle}"
                              SelectionMode="None"
                              IsSwipeEnabled="false"
                              IsItemClickEnabled="True"
                              ItemClick="itemGridView_ItemClick"
                              >
        </GridView>
    </Grid>
</Page>
